package com.binge.testThread;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.util.concurrent.TimeUnit;

/**
 * ClassName:TestThread1
 * Package:com.binge.testThread
 * Description:
 *
 * @Author @Bin
 * @Date 2024/3/1-14:10
 * @Version: v1.0
 */

@Slf4j
public class TestThread1 {



    @Test
    public  void test1() throws InterruptedException {
        Thread thread = new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                log.info("i:{}",i);
            }
            try {
                TimeUnit.SECONDS.sleep(2);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });

        thread.start();

        thread.join();







    }

}
